package com.admin.web.controller;

import com.admin.web.controller.commen.BaseController;
import com.fegin.bean.common.ztree.ZtreeBean;
import com.fegin.client.admin.MenuFegin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author 张子艺
 * @packge com.admin.controller
 * @data 2019-01-15 18:07
 * @project currencycloud
 */
@Controller
@RequestMapping("/admin/menu")
public class MenuController extends BaseController {
        @Autowired
        MenuFegin menuFegin;

    /**
     * 管理员可见菜单
     * @return
     */
    @RequestMapping(value = "/findMenuZtree" )
    @ResponseBody
    public List<ZtreeBean> findMenuZtree() {
        return  menuFegin.findMenuZtree();
    }

    /**
     * 分销商可见菜单   不能大于当前登陆用户可见菜单
     * @return
     */
    @RequestMapping(value = "/findMenuZtreeByPeople" )
    @ResponseBody
    public List<ZtreeBean> findMenuZtreeByPeople() {
        return  menuFegin.findMenuZtreeByPeople(getUser().getId());
    }


}
